import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljProductFeedbackForm, XhljProductFeedbackQuery, XhljProductFeedbackVo } from '@/api/xhlj/model/productFeedbackModel';
import { request } from '@/utils/request';

// 查询展商产品反馈留言列表
export function listProductFeedback(query?: XhljProductFeedbackQuery) {
  return request.get<TableDataInfo<XhljProductFeedbackVo>>({
    url: '/xhlj/productFeedback/list',
    params: query,
  });
}

// 查询展商产品反馈留言详细
export function getProductFeedback(feedbackId: number) {
  return request.get<R<XhljProductFeedbackVo>>({
    url: `/xhlj/productFeedback/${feedbackId}`,
  });
}

// 新增展商产品反馈留言
export function addProductFeedback(data: XhljProductFeedbackForm) {
  return request.post<R<void>>({
    url: '/xhlj/productFeedback',
    data,
  });
}

// 修改展商产品反馈留言
export function updateProductFeedback(data: XhljProductFeedbackForm) {
  return request.put<R<void>>({
    url: '/xhlj/productFeedback',
    data,
  });
}

// 删除展商产品反馈留言
export function delProductFeedback(feedbackIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/productFeedback/${feedbackIds}`,
  });
}
